<template>
	<view>
		<van-share-sheet v-model="showCompo" title="更多操作" :options="options" @select="onSelect" @cancel="toCancel" @click-overlay="toCancel"/>
	</view>
</template>

<script>
	import {Toast} from 'vant';
	export default {
		props: {
			showShare: {
				type: Boolean,
				default: false
			},
			options:{
				type:Array

			}
		},
		watch: {
			showShare(val){
				this.showCompo = val
			},
		},
		data() {
			return {
				showCompo:false,//是否显示组件
				options1: [
					// {
					// 	name:'生成发文字号',
					// 	operation:'getFwNum',
					// 	icon:'static/imgs/icon/icon-generate.png',//供更多操作里的按钮使用，因其icon不能自定义，故给其单独的icon地址
					// 	iconTab:{
					// 		active: 'static/imgs/icon/icon-generate-active.png',
					// 		inactive: 'static/imgs/icon/icon-generate.png'
					// 	},
					// 	value:operations[i].operationName,
					// },
					{
						name: '结束公文',
						code: 'finish',
						icon: 'static/imgs/icon/finished.png'
					},
					{
						name: '作废',
						code: 'disabled',
						icon: 'static/imgs/icon/disabled.png'
					},
					{
						name: '生成发文字号',
						code: 'generate',
						icon: 'static/imgs/icon/generate.png'
					},
					{
						name: '会签管理',
						code: 'sign',
						icon: 'static/imgs/icon/sign.png'
					},
				],
			};
		},
		methods: {
			onSelect(option) {
				this.$emit('closeShare', option.operation);
			},
			toCancel(){
				this.$emit('closeShare', this.showShare);
			}
		},
	};
</script>

<style>
	/* 修改share-sheet显示的图标大小 */
	/deep/ .van-share-sheet__icon {
	    width: 26px;
		height: 26px;
		margin: 0 30px;
	}
</style>
